package com.phuc.game.andPuzzle;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.phuc.game.andPuzzle.common.Utils;

public class ImageActivity extends Activity{
	String position = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.imageview);
		Bundle extras = getIntent().getExtras();
		
		if (extras != null) {
		    position = extras.getString("position");
		}
		ImageView imgView = (ImageView)findViewById(R.id.imgView);
		Utils.loadImageAssets(this, imgView, position);
	}
	
	public void onButtonClick(View view) {
		Intent intent = new Intent(this, PlayingActivity.class);
		intent.putExtra("level", position);
		startActivity(intent);
		finish();
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		Utils.unbindDrawable(findViewById(R.id.root));
	}
}
